<template>
  <swiper>
    <swiper-item v-for="(item, index) in banner" :key="index">
      <!-- <swiper-item v-for="item in banner" :key="item"> -->
      <a :href="item.link">
        <img :src="item.image" alt="" @load="swipperImage" />
      </a>
    </swiper-item>
  </swiper>
</template>

<script>
import { Swiper, SwiperItem } from "components/common/Swiper";
// import Swiper from 'components/common/Swiper/Swiper.vue'
// import SwiperItem from 'components/common/Swiper/SwiperItem.vue'

export default {
  components: { Swiper, SwiperItem },
  props: {
    banner: Array,
  },
  data() {
    return {
      isEmit: false,
    };
  },
  methods: {
    swipperImage() {
      if (!this.isEmit) {
        this.$emit("loadFinish");
        this.isEmit = !this.isEmit;
      }
    },
  },
};
</script>